<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of login
 *
 * @author Богдан
 */
class Application_Model_login extends Zend_Db_Table_Abstract 
{
    protected $_name = 'users';
    
    public function getUserRole($id) {
        $db = $this->getDefaultAdapter();
        $select = $db->select()
                     ->from(array('r' => 'roles'))
                     ->join(array('ru' => 'role_users'),
                            'r.id = ru.id_role', array('r.role'))
                     ->where('ru.id_user =?', intval($id));
        return $db->fetchRow($select);
    }    
}

?>
